<?php
	require("db.php");
	require("contant.php");	

    $start = isset($_GET['start']) ?  $_GET['start']  : 0; 
	$page = isset($_GET['page']) ?  $_GET['page'] : 5; 
   
	$sql ="select * from xzq_yuyue order by id desc limit ".$start.",".$page; //SQL语句
	$dspl = mysql_query($sql,$conn); //查询

	
	$arr = array();
    $index = 0;
	while($row = mysql_fetch_array($dspl))
   
		{
			 $temp =  array('id'=>$row['id'],'name'=>$row['name'],'tel'=>$row['tel'],'data'=>$row['data']);
		  	 $arr[$index] = ($temp);
		  	 $index++ ;		 
		}
		
	if($arr){
		$result = array("result"=>0,"message"=>"查询成功","body"=>$arr);
	}else{
		$result = array("result"=>1,"message"=>"查询失败","body"=>$arr);
	}
	
		echo json_encode($result);
?>


